//
//  T_2CollectionRView.m
//  Travel_M_Travel
//
//  Created by Sun on 15/4/3.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "T_2CollectionRView.h"
#import "UIColor+AddColor.h"

@implementation T_2CollectionRView

- (void)dealloc
{
    [_headerImageV release];
    [_headerLable release];
    [_dayLable  release];
    [_type_2Data release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if ( self) {
        self.backgroundColor =[UIColor colorFromHexCode:@"#FAF0E6"];
        
        self.headerLable = [[UILabel alloc]init];
        //        _wpHeaderLable.backgroundColor = [UIColor yellowColor];
        _headerLable.font = [UIFont fontWithName:@"Georgia" size:13];
        
        [self addSubview:_headerLable];
        
        self.dayLable = [[UILabel alloc]init];
        
        _dayLable.font = [UIFont fontWithName:@"Georgia" size:15];
        
        //        _dayLable.backgroundColor = [UIColor redColor];
        [self addSubview:_dayLable];
        
        self.headerImageV = [[UIImageView alloc]init];
        _headerImageV.contentMode = UIViewContentModeScaleAspectFit;
//        _headerImageV.image = [UIImage imageNamed:@"quan.png"];
        [self addSubview:_headerImageV];
        
        [_headerImageV release];
        [_dayLable release];
        [_headerLable release];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.headerImageV.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    self.headerLable.frame = CGRectMake(40,  0 , self.frame.size.width / 4 , self.frame.size.height);
    self.dayLable.frame = CGRectMake(self.frame.size.width * 3 / 7, 0, self.frame.size.width * 3 / 10 , self.frame.size.height);
}
- (void)setType_2Data:(AboutType_2Data *)type_2Data
{
    if (self.type_2Data != type_2Data) {
        [_type_2Data release];
        _type_2Data = [type_2Data retain];
    }
    NSString *str3 = [NSString stringWithFormat:@"%@",type_2Data.date];
    self.headerLable.text = str3;
    NSString *str = [NSString stringWithFormat:@"%@", type_2Data.day];
    NSString *str1 = @"第";
    NSString *str2 = @"天";
    str = [[str1 stringByAppendingString:str] stringByAppendingString:str2];
    self.dayLable.text = str;

}

@end
